<?php
namespace app\admin\controller;

use app\BaseController;
use think\facade\View;
use app\magicboard\ArticleTmp;
use think\facade\Request;
use think\facade\Db;
class Region extends Adm
{
	use \app\admin\traits\Curd;
    public function index()
    {
    	return $this->fetch();
    	//return View::fetch('index');
    }
    public function powerset()
    {
        return $this->fetch();
    }
    public function _add()
    {
        
        //return $this->fetch();
    }
    public function selectParent()
    {
        header('Content-Type:application/json; charset=utf-8');
        $data = Db::name('region')->select();
        $data[] = [
            "id"=>"0",
            "name"=>"中国",
            "parent_id"=>"-1"
        ];
        $response = [
            'status'=>[
                'code'=>'200',
                'msessage'=>''
            ],
            'data'=>$data
        ];
        return json($response);
    }
    public function data()
    {
        $data = Db::name('region')->select();
        $response = [
            'code'=>1,
            'msg'=>'',
            'data'=>$data
        ];
        return json($response);
    }
   
}
